import * as PIXI from 'pixi.js';

export class Game2D{
    name:string;
    app:PIXI.Application;
    width: number = window.innerWidth;
    height: number = window.innerHeight;
    constructor(canvas:any){
        
        this.app = new PIXI.Application({
            width: this.width,
            height: this.height,
            antialias: true,
            backgroundColor: 0xf0f0f0,
            backgroundAlpha: 1,
            resolution: 1,
            view: canvas
        });

        this.addView();
    }
    
    addView(){
        var sp = new PIXI.Graphics();
        sp.beginFill(0xff9900);
        sp.drawCircle(this.width / 2, this.height / 2, 50);
        sp.endFill();

        this.app.stage.addChild(sp);
    }
}